package com.jp.java8;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;

public class LambdaExpression {
    public static void main(String[] args) {
        Comparator<Apple> comparator = new Comparator<Apple>() {
            @Override
            public int compare(Apple o1, Apple o2) {
                return o1.getColor().compareTo(o2.getColor());
            }
        };
        List<Apple> list = Collections.emptyList();
        list.sort(comparator);

        Comparator<Apple> comparator1 = (o1,o2) -> {
               return o1.getColor().compareTo(o2.getColor());
            };
        list.sort(comparator1);

        Function<String,Integer> function = s -> s.length();

        Supplier<Apple> s = Apple::new;

    }

}
